/**
 * Created by fangshufeng on 2017/9/14.
 */
let webpack = require('webpack');
let path = require('path');
module.exports = {
    devtool: 'eval-source-map',
    entry:  __dirname + "/src/public/app.js",
    output: {
        path: __dirname + "/src/public",
        filename: "bundle.js"
    },
    module: {
        loaders: [
            {
                test: /\.js?$/,
                exclude: /(node_modules)/,
                loader: 'babel-loader?presets[]=react,presets[]=es2015,presets[]=stage-0',
                query: {
                    presets: ['react', 'es2015',"stage-0"],
                    "plugins": [
                        "transform-class-properties",
                        ["import", { libraryName: "antd", style: "css" }]
                    ]
                }
            },
            {
                test: /\.css$/,
                use: [ 'style-loader', 'css-loader' ]
            }
        ]
    },
    devServer: {
        contentBase: "./src/public",//本地服务器所加载的页面所在的目录
        historyApiFallback: true,//不跳转
        inline: true,//实时刷新
    }
}